package cn.tedu.egaddress1.controller;

import cn.tedu.egaddress1.mapper.AddressMapper;
import cn.tedu.egaddress1.pojo.dto.AddressAddParam;
import cn.tedu.egaddress1.pojo.entity.Address;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/exists")
public class AddressController {
    @Autowired
    private AddressMapper addressMapper;

    @PostMapping("/add")
    public String add(@RequestBody AddressAddParam addressAddParam) {
        System.out.println("addressAddParam = " + addressAddParam);
        int rows = addressMapper.insertAddress(addressAddParam);

        if (rows > 0){
            return "添加成功";
        }
        return "添加失败";
    }




    }
